/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package gestInt.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author elkin
 */
@Embeddable
public class EstudiantePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "codigo")
    private int codigo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "idpersona")
    private int idpersona;

    public EstudiantePK() {
    }

    public EstudiantePK(int codigo, int idpersona) {
        this.codigo = codigo;
        this.idpersona = idpersona;
    }

    public int getCodigo() {
        return codigo;
    }

    public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

    public int getIdpersona() {
        return idpersona;
    }

    public void setIdpersona(int idpersona) {
        this.idpersona = idpersona;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) codigo;
        hash += (int) idpersona;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EstudiantePK)) {
            return false;
        }
        EstudiantePK other = (EstudiantePK) object;
        if (this.codigo != other.codigo) {
            return false;
        }
        if (this.idpersona != other.idpersona) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gestInt.modelo.EstudiantePK[ codigo=" + codigo + ", idpersona=" + idpersona + " ]";
    }
    
}
